package com.dyh.quickdemo.junk;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class JunkTest {

    @Test
    public void test(){
        Pattern pattern = Pattern.compile("shopconf=.*不存在");
        Matcher matcher = pattern.matcher("shopconf=100001191不");
        if (matcher.find())
            System.out.println("find");
    }


    @Test
    public void test1(){
        final Foo foo = new Foo("yjsnp");

        List<Foo> foos = new ArrayList<>();
        foos.add(foo);

        Foo t =foos.get(0);
        t = new Foo("dawd");

        System.out.println();
    }

    @Test
    public void test2(){
        String str = "ab";
        System.out.println(str.charAt(str.length()-1));
    }

    @Test
    public void test3(){
        String abb = "abb";
        String ab = "ab";

        System.out.println(abb.indexOf("ac"));

    }

    @Test
    public void test4(){
        String  str = ",,,";
        System.out.println(str);
    }

    public void fun(final Foo foo){
        //编译不通过
        //foo = new Foo("adwd");
    }

    @Setter@Getter@AllArgsConstructor
    static class Foo{
        String name;
    }
}
